package com.hy.example.shared.dbaccess.repository;

import com.querydsl.core.types.Predicate;
import com.querydsl.jpa.impl.AbstractJPAQuery;
import com.querydsl.jpa.impl.JPAQuery;
import jakarta.persistence.EntityManager;
import org.springframework.data.jpa.repository.support.CrudMethodMetadata;
import org.springframework.data.jpa.repository.support.JpaEntityInformation;
import org.springframework.data.jpa.repository.support.QuerydslJpaPredicateExecutor;
import org.springframework.data.querydsl.EntityPathResolver;
import org.springframework.lang.Nullable;

public class CustomQuerydslJpaPredicateExecutor<T> extends QuerydslJpaPredicateExecutor<T> {

    public CustomQuerydslJpaPredicateExecutor(JpaEntityInformation<T, ?> entityInformation, EntityManager entityManager, EntityPathResolver resolver, CrudMethodMetadata metadata) {
        super(entityInformation, entityManager, resolver, metadata);
    }

    public AbstractJPAQuery<T, JPAQuery<T>> createJPAQuery(@Nullable Predicate predicate) {
        return (AbstractJPAQuery<T, JPAQuery<T>>) createQuery(predicate);
    }

}
